package com.controller;

import com.controller.security.Idempotent;
import com.vo.ResponseVO;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HomeController {

    @RequestMapping("/yes")
    public ResponseVO<String> repeatable(){
        return new ResponseVO<>(200, "ok", "可重复请求的服务");
    }

    @RequestMapping("/no")
    @Idempotent //加了这个注解，表明被他修饰的方法有幂等性要求
    public ResponseVO<String> noRepeatable(){
        return new ResponseVO<>(200, "ok", "不可重复请求的服务");
    }
}
